using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class EndGO : MonoBehaviour
{
    private void OnTriggerEnter(Collider other) 
    {
        Debug.Log("Leave rail way");
        GameManger.instance.CloseRailWayRange();
        gameObject.SetActive(false);
    }

            #if UNITY_EDITOR
    private void DrawGizmo(bool selected)
    {
        var col = new Color(0.0f, 0.7f, 1f, 1.0f);
        col.a = 0.7f;
        Gizmos.color = col;
        Gizmos.matrix = transform.localToWorldMatrix;
        Gizmos.DrawCube(Vector3.zero, Vector3.one);
        Gizmos.color = col;
        Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
        Handles.matrix = transform.localToWorldMatrix;
        Handles.DrawBezier(Vector3.zero, Vector3.down, Vector3.zero, Vector3.down, Color.red, null, selected ? 4f : 2f);
    }
#endif
  

#if UNITY_EDITOR
    public void OnDrawGizmos()
    {
        DrawGizmo(false);
    }
    public void OnDrawGizmosSelected()
    {
        DrawGizmo(true);
    }
#endif
}
